////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2011-2012 www.iflytek.com. All Rights Reserved.
//  This software for customer relationship management system, developed by Noo team.
//  Software code and design for the team, copy rights reserved.
////////////////////////////////////////////////////////////////////////////////

package com.iflytek.ci.cums.dao;

import java.util.List;

import com.iflytek.ci.cums.domain.Permissions;
import com.iflytek.framework.mybatis.extra.MyBatisDao;
import com.iflytek.framework.pagination.PaginationCriteria;
import com.iflytek.framework.pagination.PaginationResult;

/**
 * <p>
 * Access database DAO.
 * </p>
 *
 * @author poplar.yfyang
 * @version 1.0 2012-11-17 8:47 PM
 * @since JDK 1.5
 */
@MyBatisDao
public interface PermissionsDao {
	/**
	 * insert new permissions
	 *
	 * @param permissions permissions
	 * @return The Successful implementation of a number of SQL database.
	 */
	int add(Permissions permissions);

	/**
	 * Delete a authority data.
	 *
	 * @param id permission table's pk
	 * @return the successful implementation of a number of SQL database.
	 */
	int remove(int id);

	/**
	 * delete one or more authority data.
	 *
	 * @param ids one or more authority data.
	 * @return the successful implementation of a number of SQL database.
	 */
	int remove_more(int[] ids);

	/**
	 * delete a role data.
	 *
	 * @param role role
	 * @return The successful implementation of a number of SQL database.
	 */
	int remove_with_role(int role);

	/**
	 * A role  value.
	 *
	 * @param role role.
	 * @return a role value.
	 */
	List<Permissions> find_with_role(int role);

	/**
	 * get all permissions information page.
	 *
	 * @param criteria page
	 * @return all permissions information.
	 */
	PaginationResult<Permissions> find_page_all(PaginationCriteria criteria);
}
